package com.haojiu.service;

import com.github.pagehelper.PageHelper;
import com.haojiu.mapper.LendListMapper;
import com.haojiu.pojo.LendList;

import java.util.List;

/**
 * @author:我叫浩九
 * @date：2021/8/30 11:44
 * create in RuGao JiangSu
 */
public class LendListServiceImpl implements LendListService{
  private LendListMapper lendListMapper;
  public void setLendListMapper(LendListMapper lendListMapper){
      this.lendListMapper=lendListMapper;
  }
    @Override
    public int lendBook(LendList lendList) {
        return lendListMapper.lendBook(lendList);
    }

    @Override
    public int backBook(int  lendId) {
     return lendListMapper.backBook(lendId);
    }

    @Override
    public List<LendList> getAllLendList() {
      return lendListMapper.getAllLendList();
    }

    @Override
    public List<LendList> getAllLendList(int page, int size) {
        PageHelper.startPage(page,size);
        return lendListMapper.getAllLendList();
    }

    @Override
    public List<LendList> getAllLendList2(String userName) {
        return lendListMapper.getAllLendList2(userName);
    }

    @Override
    public List<LendList> getAllLendList2(String userName, int page, int size) {
        PageHelper.startPage(page,size);
        return lendListMapper.getAllLendList2(userName);
    }
}
